CC = gcc -g
OBJECTS_D = bdbdaemon.o
OBJECTS_C = pairctl.o
OBJECTS = $(OBJECTS_D) $(OBJECTS_C)
INCS  = -I /usr/local/BerkeleyDB.5.1/include
DEPS = -L /usr/local/BerkeleyDB.5.1/lib

all: bdbdaemon pairctl

bdbdaemon : $(OBJECTS_D)
	$(CC) -o bdbdaemon -ldb $(OBJECTS_D) $(DEPS)
pairctl : $(OBJECTS_C)
	$(CC) -o pairctl -ldb $(OBJECTS_C) $(DEPS)

bdbdaemon.o : bdbdaemon.c
	$(CC) -c bdbdaemon.c $(INCS)

pairctl.o: pairctl.c
	$(CC) -c pairctl.c $(INCS)

.PHONY : clean
clean :
	-rm bdbdaemon pairctl $(OBJECTS)
